<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition template="common/commonLayout.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core">
    <f:metadata>
        <f:event type="preRenderView" listener="#{language.setUserLocale()}"/>
    </f:metadata>
    <ui:define name="title">Пользователи</ui:define>
    <ui:define name="content">
        <h:dataTable value="#{usersOptions.users}" var="userOptions">
            <h:column>
                <f:facet name="header">№</f:facet>
                <h:outputText value="#{usersOptions.users.rowIndex+1}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Логин</f:facet>
                <h:outputText value="#{userOptions.name}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Пароль</f:facet>
                <h:inputSecret value="#{userOptions.password}"/>
            </h:column>
            <h:column>
                <f:facet name="header">API-KEY</f:facet>
                <h:outputText value="#{userOptions.apiKey}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Роли</f:facet>
                <h:outputText value="#{userOptions.roles}"/>
            </h:column>
        </h:dataTable>
    </ui:define>
</ui:composition>